<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>switch 条件分支语句</title>

    <script type="text/javascript">

        /*
            var num = 7 ;
        
            switch(num){
                case 1 :
                    console.log("壹");
                    break;
                case 2 :
                    console.log("贰");
                    break;
                case 3 :
                    console.log("叁");
                    break;
                default :
                    console.log("不合法");
                    break;
            }
        */

        /*
            var score = 77 ;
            switch (parseInt(score/10)){
                case 10:
                case 9 :
                case 8 :
                case 7 :
                case 6 :
                    console.log("合格");
                    break;
    
                default :
                    console.log("不合格");
                    break;
            }
        */

        var score = 67;
        switch (true) {

            case score >= 60 :
                console.log("合格");
                break;

            default:
                console.log("不合格");
                break;
        }

    </script>


</head>

<body>

</body>

</html>